# 指定 CMake 最低版本
cmake_minimum_required(VERSION 3.10)

project(Chat)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(DCMAKE_CXX_COMPILER "g++-9")

# 添加包含的头文件路径，子目录中不再需要添加
include_directories(global/commonFunc)
include_directories(global/config)
include_directories(global/protocol)
include_directories(json/include)
include_directories(messageCenter)

link_directories(${PROJECT_SOURCE_DIR}/)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/libs)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

# 包含 chatServer 子目录
add_subdirectory(chatServer)
add_subdirectory(chatClient)

add_subdirectory(messageCenter)

# 包含 Demo 测试子目录，将触发 Demo 目录下 CMakeLists.txt
add_subdirectory(Demo)
